//
//  NotifyingClass.m
//  TextApp
//
//  Created by Tim Isted on 08/09/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "NotifyingClass.h"
#import "MathUtilities.h"
#import "WonderfulNumber.h"

@implementation NotifyingClass

- (IBAction)displaySomeText:(id)sender
{
	NSString *firstObject = @"Milk"; 
	NSString *secondObject = @"Eggs"; 
	NSString *thirdObject = @"Butter";
	
	NSArray *shoppingListArray = [NSArray arrayWithObjects:firstObject, secondObject, thirdObject, nil];

	NSString *typedValue = [textField stringValue]; 
	shoppingListArray = [shoppingListArray arrayByAddingObject:typedValue];
	
	NSString *stringToOutput = @"The shopping list is: "; 
	stringToOutput = [stringToOutput stringByAppendingString:[shoppingListArray componentsJoinedByString:@", "]];
	[textView insertText:stringToOutput];
}

- (float)generateValue:(float *)originalValue
{
	float radius = [textField floatValue];
	*originalValue = radius;
	float circumference = [MathUtilities circumferenceFromRadius:radius];
	return circumference;
}

@end